<template>
    <div class="iframe">
        <div class="i-title">
            <h3>父与子传参</h3>
        </div>
        <div class="i-tip">
            显示输出值：{{info.name}},{{info.msg}},{{info.say}}
        </div>
        <slot></slot>
        <div class="i-tip">
            <el-button @click="giveValue">传参</el-button>
        </div>
    </div>
</template>

<script>
    import {
        reactive
    } from "vue"
    export default {
        props: [
            "msg",
            "say"
        ],
        emits: ["giveF"],
        setup(props, context) {
            let info = reactive({
                name: "tgrong",
                msg: props.msg,
                say: props.say
            })
            function giveValue() {
                context.emit("giveF", "今天是个大晴天")
            }
            return {
                info,
                giveValue
            }
        }
    }
</script>

